Skip to content

Narrow to non-empty-string via Strings::length#207

Merged
staabm merged 6 commits into
phpstan:2.0.xfrom
staabm:narrow-length
Jun 24, 2026
Merged

Narrow to non-empty-string via Strings::length#207
staabm merged 6 commits into
phpstan:2.0.xfrom
staabm:narrow-length

Conversation

@staabm

@staabm staabm commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@staabm staabm marked this pull request as ready for review June 24, 2026 07:17
@staabm staabm requested a review from VincentLanglet June 24, 2026 07:17
Comment thread stubs/Utils/Strings.stub Outdated
*/
class Strings
{
/** @phpstan-assert-if-true non-empty-string $s */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kinda hacky given the fact it doesn't return true, no ? Does the same strategy is used somewhere else ?

@staabm staabm Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh thats a great point. maybe we should even error in such case?

@staabm staabm merged commit 3dace7c into phpstan:2.0.x Jun 24, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants